// 导入 axios
import axios from '@/utils/index.js'
// import store from '@/store/index.js'

// export default 123

// 1.获取登录用户的频道---------------------------------
export const getUserChannels = (mobile, code) => {
  return axios({
    method: 'get',
    url: '/v1_0/user/channels'
  })
}

// 2.获取所有频道---------------------------------
export const getAllChannels = () => {
  return axios({
    method: 'get',
    url: '/v1_0/channels'
  })
}
// 3 添加 频道 到我的频道
export const addChannel = (channels) => {
  return axios({
    method: 'patch',
    url: '/v1_0/user/channels',
    data: { channels: [channels] }
  })
}
//  从我的 频道 中 删除 这个 频道
export const removeChannel = (target) => {
  return axios({
    method: 'DELETE',
    url: `/v1_0/user/channels/${target}`
  })
}
